Field oriented control dataset of a 3-phase permanent magnet synchronous motor

This paper presents a dataset of a 3-phase Permanent Magnet Synchronous Motor (PMSM) controlled by a Field Oriented Control (FOC) scheme. The data set was generated from a simulated FOC motor control environment developed in Simulink; the model is available in the public GitHub repository1. The dataset includes the motor response to various input signal shapes that are fed to the control scheme to verify the control capabilities when the motor is subjected to real life scenarios and corner conditions. Motor control is one of the most widespread fields in control engineering as it is widely used in machine tools and robots, the FOC scheme is one of the most used control approaches thanks to its performance in speed and torque control, with the drawback of having to handcraft the Proportional-Integrative-Derivative (PID) regulators using Look Up Tables (LUT). The test conditions are designed by setting a motor desired speed. Different input speed variations shapes are proposed as well as extreme scenarios where the linear behaviour of the PID regulator is challenged by applying fast and high magnitude speed variations so that the PID controller is not able to correctly follow the reference. The measured data includes both the outer and inner-loop signals of the FOC, which opens the possibility to develop non-linear control approaches such as Machine Learning (ML) and Neural Networks (NN) with different topologies to replace the linear controllers in the FOC scheme.


a b s t r a c t
This paper presents a dataset of a 3-phase Permanent Magnet Synchronous Motor (PMSM) controlled by a Field Oriented Control (FOC) scheme. The data set was generated from a simulated FOC motor control environment developed in Simulink; the model is available in the public GitHub repository 1 . The dataset includes the motor response to various input signal shapes that are fed to the control scheme to verify the control capabilities when the motor is subjected to real life scenarios and corner conditions. Motor control is one of the most widespread fields in control engineering as it is widely used in machine tools and robots, the FOC scheme is one of the most used control approaches thanks to its performance in speed and torque control, with the drawback of having to handcraft the Proportional-Integrative-Derivative (PID) regulators using Look Up Tables  (LUT). The test conditions are designed by setting a motor desired speed. Different input speed variations shapes are proposed as well as extreme scenarios where the linear behaviour of the PID regulator is challenged by applying fast and high magnitude speed variations so that the PID controller is not able to correctly follow the reference. The measured data includes both the outer and inner-loop signals of the FOC, which opens the possibility to develop non-linear control approaches such as Machine Learning (ML) and Neural

Value of the Data
This dataset simulates the behaviour of a 3-phase PMSM motor controlled using the FOC scheme [1] , the signal values of the rotating DQ frame voltage and current are gathered both for the reference and measured signal. The dataset also includes the signal value of the reference and measured speed which is a valuable tool for the development and validation of ML algorithms for motor control without the need of having a physical motor to produce data.
• It contains data generated for both real life scenarios and corner conditions to stress to the maximum the linear controllers (PID) deployed in the FOC scheme. • Practitioners working on motor control applying a ML or NN approach can benefit greatly from this dataset, as it removes the need to dump measurements directly from a physical motor. • The dataset can be used, for example, in ML tasks such as training, testing, and validating a NN. The dataset can be used to train and test various architectures of ML and NN based regressors. • ML approaches can be adopted for defining the actual operating conditions of the controller [step-generated], and then test the performance when applying an extreme condition scenario [random-generated] [2,3] .

Objective
This dataset was created to mimic the response of a PMSM when subjected to a wide set of input speed shapes as well as test conditions specifically designed to highlight how the nonlinearities affect the PID controller present in the FOC scheme, in this way, a physical motor to gather data is no longer needed. The inclusion of non-linear boundary brings the possibility to design a non-linear control approach such as ML or NN based control, capable of matching and, if possible, outperforming the behavior of a PID regulator in certain situations [4] .

Data Description
input scenario fed to the motor control scheme. The main folder Motor_Control_Dataset is divided in four branches, each one corresponding to the type of signal that the system has as input.
The first branch 1_Step_Input contains data gathered when a step input is applied to the system, the second branch presents data obtained through ramp inputs ( 2_Ramp_Input ) with different slopes. The content of 3_Random_Signal and 4_Generated_Signal is a set of test cases based on a random and a graphically designed signal respectively.
The directory tree is organized as follows: Step Input Branch The subfolder 1_Step_Input contains five test cases obtained by setting a step input with Each test case is named as it follows: branches. An example of the test case 25_step.mat is shown in Table 2 . The columns correspond to the parameters described in table 1 .

Ramp Input Branch
The directory structure is very similar to the step input branch and is reported below. The difference is the type of signal that will be input to the system, in this case is a ramp that will  The test cases are defined by changing the slope value, which is expressed as a percentage of the maximum motor speed (150 0 0 rpm).
The ramp data set contains five different cases where the slope is varying from a 10% to a 100% slope value, changing the time needed to reach the maximum speed value that the motor can provide. Fig. 2 a shows the ramp response for a slope of 20% (30 0 0 rpm/s), while Fig. 2 b presents the response to a ramp with a slope of 80% (120 0 0 rpm/s).

Random Signal Input Branch
The third directory follows the same format as the previous two and it is shown below. In this case, the test cases are defined by applying a random signal generated around a random mean value. The motor runs for 10 seconds in each test considering the first second as the open loop start. The four test cases are named by considering the mean speed value around which the signal was generated (In this case: 20%, 40%, 70% and 100%). Multiple random test cases are considered to verify how the system reacts to fast speed changes, and if this behaviour varies when the mean value of the speed changes, recalling that the speed is normalized considering the maximum motor speed of 150 0 0 rpm.

Graphically Designed Signal Input Branch
The fourth and last directory keeps the same format as the first three directories mentioned above. The difference with this branch is that the input signal is a graphically designed signal generated through the "signal builder" block in Simulink, where the user can design the shape of a signal by "drawing" the waveform. This input shape gives the possibility to the user to test the control performance of the system when subjected to a desired input, while also opening the possibility to test specific conditions to highlight the controller flaws to nonlinearities, which are present when the controller is subjected to high magnitude speed variations, or very fast transitions. The directory tree is shown below: Fig. 4 a shows the response for the test case 1_generated , while Fig. 4 b presents the response to the test case 3_generated . Both signals were built to show the overshoot caused by high magnitude speed variations.

Experimental Design, Materials and Methods
The dataset is based on a simulated environment of a FOC scheme implemented in Simulink to control the speed of a 7 pole Permanent Magnet Synchronous Machine with a maximum speed of 150 0 0rpm when no torque is applied. To gather data from the deigned environment, a test set of inputs was designed to verify how the controller reacts to the target speed. The Simulink model is available in [5] .

Motor Model
For the model of the motor, the "Surface mounted PMSM" block ( Fig. 5 ) was used, which is part of the Motor Control Block set provided by Matlab, it internally considers all the machine dynamics and the final transfer function. Then, this block was tuned with the parameters of the motor ( Table 3 ) obtained through the Motor Profiler software available at 2 .

FOC Scheme
The FOC scheme is shown in Fig. 6 , where the acquired signals (defined in Table 2 ) are labeled for an easier understanding of the process. Some blocks such as the Clarke, Park, and Inverse Clarke transform are also included within the motor control block set. The model implementation in Simulink is based on the sensorless FOC scheme developed by Mathworks 3 , and the controller gains for the PID where obtained using the Motor Control Workbench provided by ST [6] .   Remark: This FOC scheme requires that that the motor starts in open-loop control, which is achieved when the desired speed is under the 10% of the maximum motor speed. This is considered in every test case, where the first simulation second of every data array corresponds to open-loop control. This data points may be deleted before incurring into ML applications to avoid overfitting with the same data values in every test case instead of considering more valuable data.

Test Cases Generation
In this section, the input signals for the Simulink environment are defined. The test cases are variations of target speed when a step, ramp and random signals are applied to the system; Then, also specific signals are manually generated to verify the controller behavior to nonlinear dynamics.

Step Input
For the first branch, a step block is used as an input to the FOC scheme where the starting point is the open loop speed (10% of maximum motor speed), and then after one simulation second has elapsed, the final value of the step is the desired motor speed. As an example, the target speed from test case 40_step.mat ( Fig. 7 ) is set up with the following values: -Initial value: Open loop speed (1500 rpm). The five test cases present in the dataset are related to five different speed targets corresponding to 20, 40, 60, 80, and 100% of the maximum motor speed, which is 150 0 0 rpm as mentioned in previous sections.

Ramp Input
The second branch uses a ramp block for the input signal, the considerations of an open-loop start for the motor still hold. In every test case, the block is parametrized as follows: -Initial output: Open loop speed (1500 rpm) -Start time: 1 second (Open loop start of the motor) Step input for a 40% speed value. To variate the testing, the slope value in each test case is set to a percentage of the maximum motor speed. An example slope value for the test case 80_ramp.mat is presented below, and the overall target speed signal is shown in Fig. 8 .

Random Signal Input
The third branch uses a random source block for the input signal, this block sets a random mean value in a given range [1500 -150 0 0 rpm], the signal is generated on this mean value. To guarantee that the motor starts in open-loop control, a step input like the one presented in the test case step_10 is applied with the following values: -Initial value: Open loop speed (1500 rpm). The random signal needs to be delayed 1 second while the motor is starting in open loop, the developed input block scheme is presented in Fig. 9 . Four random signals are included in the dataset, each of which is generated around a different mean value (20%, 40%, 70%, and 100%) of the maximum motor speed. The goal is to verify if the system is able to react at fast speed variations, and also, verify how the controller reacts when having speed variations around low speeds (e.g. 20% mean value) compared to high speed variations (e.g. 100% mean value). As an example, the target speed from test case 70_random.mat is shown in Fig. 10 .

Graphically Designed Signal Input
For the fourth and final branch, the input signal is graphically designed using the "signal builder" block, where the user can graphically generate the desired input signal and adjust its duration. In this test cases the signals were defined by designing high magnitude speed changes, and in some cases, fast speed transitions to bring the system out of control. An example of a generated signal is shown in Fig. 11 , during the first second, the motor is under 10% of the maximum speed to start in open loop. The signal never falls under the 10% speed limit to keep the closed-loop control.